﻿namespace ARS.PublicTool.WebHelper.WebPage
{
    public class ScriptHelper
    {
        public static string GetScriptStr(string script)
        {
            return string.Format("<script type=\"text/javascript\">{0}</script>",script);
        }

        public static string GetScriptSrc(string path)
        {
            return string.Format("<script src=\"{0}\" type=\"text/javascript\"></script>",path);
        }
        /// <summary>
        /// 跳转
        /// </summary>
        /// <param name="page"></param>
        /// <param name="url">地址</param>
        /// <param name="time">毫秒</param>
        public void Redirect(System.Web.UI.Page page, string url, int time)
        {
            page.ClientScript.RegisterStartupScript(page.GetType(), "tz", string.Format("<script type=\"text/javascript\">setTimeout(\"window.location.href='{0}'\",{1});</script>",url,time));
             
        }
    }
}
